#include "v3Response.hpp"
#include "action_constants.hpp"

namespace etcdv3 {

void V3Response::set_error_code(int code) {
    error_code = code;
}

void V3Response::set_error_message(std::string msg) {
    error_message = msg;
}

int64_t V3Response::get_index() const {
    return index;
}

std::string const& V3Response::get_action() const {
    return action;
}

int V3Response::get_error_code() const {
    return error_code;
}

std::string const& V3Response::get_error_message() const {
    return error_message;
}

void V3Response::set_action(std::string action) {
    this->action = action;
}

std::vector<KeyValue> const& V3Response::get_values() const {
    return values;
}

std::vector<KeyValue> const& V3Response::get_prev_values() const {
    return prev_values;
}

KeyValue const& V3Response::get_value() const {
    return value;
}

KeyValue const& V3Response::get_prev_value() const {
    return prev_value;
}

bool V3Response::has_values() const {
    return values.size() > 0;
}

}